﻿using Domain.Entity.ord;
using Domain.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Domain.Entity.search;

namespace Application.ISale_hService
{
    public interface ISale_hService
    {
        //分页查询销售单
        Task<FenYe<Sale_h>> GetSale_h(FenYe<Sale_h> fenYe, string? code, int? status, int? cust, string? starttime, string? endtime);


        //高级查询
        Task<FenYe<Sale_h>> GetAdvancedSale_h(FenYe<Sale_h> fenYe, string? code, string? starttotal, string? endtotal, string? startdate, string? enddate, string? startnum, string? endnum, int? status, int? cust, string? custlink, int? dep, int? user, string? createname, string? startcreatetime, string? endcreatetime, string? approvername, string? startapprovertime, string? endapprovertime);


        //添加销售单
        Task<int> AddSale_h(AddSale_hDto addSale_HDto);

        //根据id查询销售单
        Task<Sale_h> GetSale_HById(int id);

        //修改销售单
        Task<int> UpdateSale_h(UpdateSale_hDto updateSale_HDto);

        //删除销售单
        Task<int> DeleteSale_h(int id);

        //修改销售单据状态
        Task<int> UpdateStatus(int saleid, int status);

        //审核销售单
        Task<int> ApproverSale_h(int saleid, int status, string approvername, string approvertime);

        //查询所有销售单
        Task<List<Sale_h>> GetSale_Hs();

        //更新出库数量及状态
        Task<int> UpdateNum(int saleid, int oknum, int nonum, int statu);


        //根据销售编号查询主键id和销售总数
        Task<Sale_h> Getid(string code);

        //更新已退货数量及状态
        Task<int> UpdateRNum(int saleid, int returnnum, int status);

        //根据货品id查询销售记录
        Task<List<Sale_h>> GetAllSale_hBypid(int procid);

        //销售统计
        Task<SaleTJResult> Sale_hTJ(string? timeType, string? code, int? cust, int? user, int? dep, string? starttime, string? endtime, int? page, int? pagesize);

        //更新已退货数量及状态
        Task<int> UpdateRNum(int saleid, int returnnum, int status, int newnum);
    }
}
